let marker = null;
export const amapSetMarker = (lnglat, map) => {
  if (marker) {
    map.remove(marker)
    marker = null;
  }
  marker = new AMap.Marker({
    position: [lnglat.lng, lnglat.lat]
  })
  map.add(marker);
  map.setFitView();
}

export const claenMarker = (map) => {
  if (marker) {
    map.remove(marker)
    marker = null;
  }
}